//////https://www.luogu.com.cn/problem/P2918
////
////#include<iostream>
////
////using namespace std;
////
////const int N = 110, H = 5e5 + 10;
////int p[N], c[N], dp[N][H];
////
////int main()
////{
////	int n, h; cin >> n >> h;
////	for (int i = 1; i <= n; i++) cin >> p[i] >> c[i];
////	for (int j = 1; j <= h; j++)dp[0][j] = 0x3f3f3f3f;
////	for (int i = 1; i <= n; i++)
////	{
////		for (int j = 0; j <= h; j++)
////		{
////			dp[i][j] = min(dp[i - 1][j], dp[i][max(0, j - p[i])] + c[i]);
////		}
////	}
////	cout << dp[n][h] << endl;
////	return 0;
////}
//
//#include<iostream>
//
//using namespace std;
//
//const int N = 110, H = 5e5 + 10;
//int p[N], c[N], dp[H];
//
//int main()
//{
//	int n, h; cin >> n >> h;
//	for (int i = 1; i <= n; i++) cin >> p[i] >> c[i];
//	for (int j = 1; j <= h; j++)dp[j] = 0x3f3f3f3f;
//	for (int i = 1; i <= n; i++)
//		for (int j = 0; j <= h; j++)
//			dp[j] = min(dp[j], dp[max(0, j - p[i])] + c[i]);
//	cout << dp[h] << endl;
//	return 0;
//}